package com.alks.pad.controller.stitchAccount;

import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.pad.data.request.stitchAccount.DeptRequest;
import com.alks.pad.service.stitchAccount.StitchDateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/pad/stitchDate")
@Api(value = "针车件资App", tags = {"针车件资App-查询"})
public class StitchDateController {

    @Autowired
    private StitchDateService stitchDateService;

    @WebLogger
    @GetMapping("/getDeptNameList")
    @ApiOperation(value = "当前账号的组别查询",tags = "针车件资App-查询")
    public ResponseInfo getDeptNameList(){
        return stitchDateService.getDeptNameList();
    }

    @WebLogger
    @PostMapping("/getEmployeelList")
    @ApiOperation(value = "员工查询",tags = "针车件资App-查询")
    public ResponseInfo getEmployeelList(@RequestBody DeptRequest request){
        return stitchDateService.getEmployeelList(request);
    }

    @WebLogger
    @GetMapping("/getAllDeptNameList")
    @ApiOperation(value = "所有组别查询",tags = "针车件资App-查询")
    public ResponseInfo getAllDeptNameList(@RequestParam(required = false) String deptName){
        return stitchDateService.getAllDeptNameList(deptName);
    }
}
